package com.online.teaching.dao;
import com.online.teaching.pojo.Teaches;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.additional.idlist.SelectByIdListMapper;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/****
 * @Author:admin
 * @Description:Teaches的Dao
 * @Date 2019/6/14 0:12
 *****/
public interface TeachesMapper extends Mapper<Teaches>, SelectByIdListMapper<Teaches, Integer> {
    /**
     * 管理员查询用户列表
     * @return
     */
    @Select("SELECT * from teaches WHERE is_valid=1")
    List<Teaches> adminFindCourse();

    /**
     * 老师获取其正在授课的列表
     * @param teacherId
     * @return
     */
    @Select("SELECT * FROM teaches WHERE teaches_id =#{teaches_id} AND is_valid=1")
    List<Teaches>getTeachesList(@Param("teaches_id") Integer teacherId);
}
